home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / gmp-132.lha / gmp-1.3.2 / mpz_set_str.c < prev    next >
C/C++ Source or Header  |  1993-05-02  |  1KB  |  42 lines

  1. /* mpz_set_str(mp_dest, string, base) -- Convert the \0-terminated
  2.    string STRING in base BASE to multiple precision integer in
  3.    MP_DEST.  Allow white space in the string.  If BASE == 0 determine
  4.    the base in the C standard way, i.e.  0xhh...h means base 16,
  5.    0oo...o means base 8, otherwise assume base 10.
  6.  
  7. Copyright (C) 1991 Free Software Foundation, Inc.
  8.  
  9. This file is part of the GNU MP Library.
  10.  
  11. The GNU MP Library is free software; you can redistribute it and/or modify
  12. it under the terms of the GNU General Public License as published by
  13. the Free Software Foundation; either version 2, or (at your option)
  14. any later version.
  15.  
  16. The GNU MP Library is distributed in the hope that it will be useful,
  17. but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19. GNU General Public License for more details.
  20.  
  21. You should have received a copy of the GNU General Public License
  22. along with the GNU MP Library; see the file COPYING.  If not, write to
  23. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  24.  
  25. #include "gmp.h"
  26. #include "gmp-impl.h"
  27. #include "longlong.h"
  28.  
  29. int
  30. #ifdef __STDC__
  31. mpz_set_str (MP_INT *x, const char *str, int base)
  32. #else
  33. mpz_set_str (x, str, base)
  34.      MP_INT *x;
  35.      const char *str;
  36.      int base;
  37. #endif
  38. {
  39.   /* Go via _mpz_set_str, as that can be used by BSD compatible functions.  */
  40.   return _mpz_set_str (x, str, base);
  41. }
  42.